import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);
import cartStore from './module/cart'
export default new Vuex.Store({
  state: {
    num: 1,
    navFlag: true
  },
  mutations: {
    changeNum (state, count) {
      state.num += count;
    }
  },
  getters: {
    numGetters: state => state.num * 10,
    // num: function (state) {
    //   return state.num * 10
    // }
  },
  actions: {
    // numActions (context, num) {
    //   context.commit("changeNum", num)
    // },
    numActions ({ commit }, num) {
      commit("changeNum", num)
    }
  },
  modules: {
    cartStore
  }
});
